package com.gxaedu.rbac.exception;

import com.gxaedu.rbac.dto.ResponseData;
import com.gxaedu.rbac.dto.ResultData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author:Teacher黄
 * @date:Created at 2020/04/22
 */
@RestControllerAdvice
public class MyExceptionHandler {


    /**
     * 捕获权限异常相关信息
     * @param e
     * @return
     */
    @ExceptionHandler(RbacException.class)
    ResultData rbacException(RbacException e){

        return ResponseData.error(e.getCode(),e.getMsg());
    }



}
